package tmall.util;

/**
 * Get time or date.
 * @author Harry Chou
 * @date 2019/3/3
 */
public class DateUtil {
    public static java.sql.Timestamp d2t(java.util.Date d) {
        if (null == d) {
            return null;
        }
        return new java.sql.Timestamp(d.getTime());
    }

    public static java.util.Date t2d(java.sql.Timestamp t) {
        if (null == t) {
            return null;
        }
        return new java.util.Date(t.getTime());
    }
}
